﻿<UserControl x:Class="HierarchicalDisplay"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:local="clr-namespace:Hinshelwood.TFSStickyBuddy"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>

        <!-- Animation for showing the Item Info control -->
        <!--<Storyboard x:Key="ShowItemInfo" Completed="ShowItemInfo_StoryboardCompleted">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemInfoControl" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemInfoControl" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>-->

        <!-- Animation for hiding the Item Info control -->
        <!--<Storyboard x:Key="HideItemInfo" Completed="HideItemInfo_StoryboardCompleted">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ItemInfoControl">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemInfoControl" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>-->

        <!-- Animation for showing the Family Data control -->
        <!--<Storyboard x:Key="ShowFamilyData" Completed="ShowFamilyData_StoryboardCompleted">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataControl" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataControl" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>-->

        <!-- Animation for hiding the Family Data control -->
        <!--<Storyboard x:Key="HideFamilyData" Completed="HideFamilyData_StoryboardCompleted">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FamilyDataControl">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataControl" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>-->

        <!-- Animation for showing the Working control -->
        <Storyboard x:Key="ShowWorkingControl" Completed="ShowWorking_StoryboardCompleted">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="WorkingUserControl">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="WorkingUserControl" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

        <!-- Animation for hiding the Working control -->
        <Storyboard x:Key="HideWorkingControl" Completed="HideWorking_StoryboardCompleted">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="WorkingUserControl">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="WorkingUserControl" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

        <!-- Animation for showing the Credential provider control -->
        <Storyboard x:Key="ShowCredentialProviderBox">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CredentialProviderBox">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CredentialProviderBox" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

        <!-- Animation for hiding the Working control -->
        <Storyboard x:Key="HideCredentialProviderBox">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CredentialProviderBox">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="CredentialProviderBox" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

    </UserControl.Resources>
    <!--Setup menu command bindings-->
    <UserControl.CommandBindings>
        <CommandBinding Command="local:HierarchicalDisplay.ChangeTeamServerCommand" Executed="ChangeTeamServer_Start"/>
        <CommandBinding Command="local:HierarchicalDisplay.ChangeSkinCommand" Executed="ChangeSkin"/>
        <CommandBinding Command="local:HierarchicalDisplay.ChangeLifeCycleCommand" Executed="ChangeLifeCycle"/>
        <CommandBinding Command="local:HierarchicalDisplay.ChangeTeamProjectCommand" Executed="ChangeTeamProject"/>
        <CommandBinding Command="local:HierarchicalDisplay.SelectStoredQueryCommand" Executed="SelectStoredQuery"/>
        <CommandBinding Command="local:HierarchicalDisplay.DisplayByCommand" Executed="DisplayBy"/>
        <CommandBinding Command="local:HierarchicalDisplay.CodeplexCommand" Executed="Codeplex"/>
    </UserControl.CommandBindings>
    <DockPanel Name="MainWindowContent" Background="{DynamicResource MainBackgroundBrush}">
        <!-- Menu Area -->
        <Border x:Name="MenuBorder" VerticalAlignment="Top" HorizontalAlignment="Stretch" DockPanel.Dock="Top" Margin="0,5,0,5">
            <DockPanel>
                <StackPanel Name="SearchPanel" Opacity="0.5" IsEnabled="False" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" FlowDirection="LeftToRight" Margin="5,0,10,0">
                    <Label VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="2">Quick Search:</Label>
                    <TextBox Name="SearchText" VerticalContentAlignment="Center" MinWidth="150">[enter search]</TextBox>
                    <Button Width="Auto" Padding="2" MinWidth="20" IsEnabled="False">Go</Button>
                </StackPanel>
                <Menu VerticalAlignment="Bottom" Margin="5,0,0,0" Style="{DynamicResource MenuStyle}">
                    <MenuItem Header="_Servers" x:Name="ConnectMenu" Style="{DynamicResource MenuItemStyle}" />
                    <MenuItem Header="_Projects" x:Name="ProjectsMenu" Style="{DynamicResource MenuItemStyle}"/>
                    <MenuItem Header="_Querys" x:Name="WorkItemQueryMenu" Style="{DynamicResource MenuItemStyle}"/>
                    <MenuItem Header="_Display By" x:Name="DisplayByMenu" Style="{DynamicResource MenuItemStyle}">
                        <MenuItem Header="Area" IsEnabled="False" Style="{DynamicResource MenuItemStyle}" />
                        <MenuItem Header="Iteration" IsEnabled="False" Style="{DynamicResource MenuItemStyle}" />
                    </MenuItem>
                    <MenuItem Header="S_kins" x:Name="SkinsMenu" Style="{DynamicResource MenuItemStyle}"/>
                    <MenuItem Header="Life _Cycles" x:Name="LifeCyclesMenu" Style="{DynamicResource MenuItemStyle}"/>
                    <MenuItem Header="_Help" x:Name="CodeplexMenu" Style="{DynamicResource MenuItemStyle}">
                        <MenuItem x:Name="CodeplexMenu_Home" Header="View documentation" Command="local:HierarchicalDisplay.CodeplexCommand" CommandParameter="Home" IsEnabled="True" Style="{DynamicResource MenuItemStyle}" />
                        <MenuItem x:Name="CodeplexMenu_Release" Header="View latest release" Command="local:HierarchicalDisplay.CodeplexCommand" CommandParameter="Release" IsEnabled="True" Style="{DynamicResource MenuItemStyle}" />
                        <MenuItem x:Name="CodeplexMenu_Discussions" Header="Discuss new features and issues" Command="local:HierarchicalDisplay.CodeplexCommand" CommandParameter="Discussions" IsEnabled="True" Style="{DynamicResource MenuItemStyle}" />
                        <MenuItem x:Name="CodeplexMenu_IssueTracker" Header="Submit an Issue or New Feature" Command="local:HierarchicalDisplay.CodeplexCommand" CommandParameter="IssueTracker" IsEnabled="True" Style="{DynamicResource MenuItemStyle}" />
                        <MenuItem x:Name="CodeplexMenu_SourceCode" Header="Download latest source code" Command="local:HierarchicalDisplay.CodeplexCommand" CommandParameter="SourceCode" IsEnabled="True" Style="{DynamicResource MenuItemStyle}" />
                        <MenuItem x:Name="CodeplexMenu_License" Header="View license" Command="local:HierarchicalDisplay.CodeplexCommand" IsEnabled="True" CommandParameter="License" Style="{DynamicResource MenuItemStyle}" />
                    </MenuItem>
                </Menu>
            </DockPanel>
        </Border>

        <Grid x:Name="MainGrid" Grid.IsSharedSizeScope="True" DockPanel.Dock="Top" >

            <!-- Diagram Area -->
            <Grid x:Name="DiagramPane" Margin="10,0,10,10">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <!-- The column 1 clone is used when the details area is collapsed -->
                    <ColumnDefinition x:Name="column1CloneForLayer0" SharedSizeGroup="column1"/>
                </Grid.ColumnDefinitions>
                <Border Background="{DynamicResource DiagramGradientBrush}" Style="{DynamicResource BorderStyle}" x:Name="DiagramBorder">
                    <local:DiagramViewer x:Name="DiagramControl" Zoom="1.5" />
                </Border>
            </Grid>

            <!-- Details Area -->
            <Grid x:Name="DetailsPane" Margin="10,0,10,10" Visibility="Visible">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition SharedSizeGroup="column1" Width="300"/>
                </Grid.ColumnDefinitions>
                <!--<local:Details DataContext="{Binding}" Grid.Column="1" x:Name="DetailsControl" Margin="5,0,0,0" ItemInfoClick="DetailsControl_ItemInfoClick" EveryoneDeleted="DetailsControl_EveryoneDeleted" FamilyDataClick="DetailsControl_FamilyDataClick" />-->
                <GridSplitter Width="5" Grid.Column="1" HorizontalAlignment="Left" Background="{DynamicResource MainBackgroundBrush}" BorderThickness="0,10,0,10"/>
            </Grid>

            <!-- New User Control -->
            <!--<local:NewUserControl x:Name="NewUserControl" HorizontalAlignment="Center" VerticalAlignment="Center" AddButtonClick="NewUserControl_AddButtonClick" CloseButtonClick="NewUserControl_CloseButtonClick" />-->

            <!-- Welcome User Control -->
            <local:Welcome x:Name="WelcomeUserControl" HorizontalAlignment="Center" VerticalAlignment="Center" />
            <!-- Working User Control -->
            <local:Working x:Name="WorkingUserControl" Visibility="Hidden" HorizontalAlignment="Center" VerticalAlignment="Center" />

            <local:CredentialProviderBox x:Name="CredentialProviderBox" Visibility="Hidden" HorizontalAlignment="Center" VerticalAlignment="Center" />
            <!-- Item Info Control -->
            <!--<local:ItemInfo x:Name="ItemInfoControl" Opacity="0" Visibility="Hidden" CloseButtonClick="ItemInfoControl_CloseButtonClick" />-->

            <!-- Family Data Control -->
            <!--<local:FamilyData x:Name="FamilyDataControl" Opacity="0" Visibility="Hidden" CloseButtonClick="FamilyDataControl_CloseButtonClick" />-->

        </Grid>
    </DockPanel>
</UserControl>
